package com.liy.framework.web.spring.controller;

import org.springframework.stereotype.*;
import org.springframework.boot.actuate.health.*;
import java.lang.management.*;

@Component("mem")
public class SystemCustomerHealthIndicator implements HealthIndicator
{
    public Health health() {
        final Runtime runtime = Runtime.getRuntime();
        final long use = ManagementFactory.getMemoryMXBean().getNonHeapMemoryUsage().getUsed();
        return Health.up().withDetail("total", (Object)((runtime.totalMemory() + use) / 1024L)).withDetail("free", (Object)(runtime.freeMemory() / 1024L)).build();
    }
}
